package com.example.idachuappone.cook.entity;

import java.io.Serializable;
import org.json.JSONObject;

public class Recipe implements Serializable {
    private String id;
    private String img;
    private String img_small;
    private String kitchener_id;
    private String name;
    private String oid;
    private String recipe_id;

    public Recipe parseJson(JSONObject json) {
        if (json == null) {
            return null;
        }
        if (json.has("id")) {
            this.id = json.optString("id");
        }
        if (json.has("name")) {
            this.name = json.optString("name");
        }
        if (json.has("oid")) {
            this.oid = json.optString("oid");
        }
        if (json.has("kitchener_id")) {
            this.kitchener_id = json.optString("kitchener_id");
        }
        if (json.has("recipe_id")) {
            this.recipe_id = json.optString("recipe_id");
        }
        if (json.has("img")) {
            this.img = json.optString("img");
        }
        if (!json.has("img_small")) {
            return this;
        }
        this.img_small = json.optString("img_small");
        return this;
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOid() {
        return this.oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public String getKitchener_id() {
        return this.kitchener_id;
    }

    public void setKitchener_id(String kitchener_id) {
        this.kitchener_id = kitchener_id;
    }

    public String getRecipe_id() {
        return this.recipe_id;
    }

    public void setRecipe_id(String recipe_id) {
        this.recipe_id = recipe_id;
    }

    public String getImg() {
        return this.img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getImg_small() {
        return this.img_small;
    }

    public void setImg_small(String img_small) {
        this.img_small = img_small;
    }
}
